/*
 * @Author: dingxiao
 * @Date: 2025-06-30 15:07:18
 * @Description: 调研表单接口服务
 */

import { postData, getDatas, postNestedData } from '@/api/data-source/commonRequestApi';

class ResearchFormService {
  /**
   * 随机获取调研测验答题列表信息
   */
  getQuestionRandom = () => getDatas('/question-config/get-question-random')

  /**
   * 计算答题得分
   */
  getTotalScore = (params) => postData('/question-config/get-total-score', params)

  /**
   * 表单获取当前租户下连带性动作配置
   */
  getTenantList = () => getDatas('/subject-manage/list-by-tenant')

  /**
   * 分页获取基层联络点配置接口
   */
  getContactPage = (params) => postData('/grassroots-contact-config/page', params)

  /**
   * 下载主要行程模板
   */
  downloadTemplate = () => postData('/main-itinerary/download-template', {}, {
    responseType: 'blob'
  })

  /**
   * 导入主要行程
   */
  importMainItinerary = (params) => postData('/main-itinerary/import', params)

  /**
   * 分页公司领导人配置信息
   */
  getConfigPage = (params) => postData('/leadership-config/page', params)

  /**
   * 新增公司领导人配置信息
   */
  addConfigSave = params => postData('/leadership-config/save', params);

  /**
   * 公司领导人排序
   */
  leadershipUpdateOrder = params => postData('/leadership-config/update-order', params);

  /**
   * 删除公司领导人配置信息
   */
  delConfigDelete = params => postData('/leadership-config/delete', params);

  /**
   * 公司领导人配置信息详情
   */
  deetsConfigDetail = params => postData('/leadership-config/detail', params);

  /**
   * 更新公司领导人配置信息
   */
  updConfigUpdate = params => postData('/leadership-config/update', params);

  /**
   * 分页获取八项规定题库
   */
  getQuestionConfigPage = params => postData('/question-config/page', params);

  /**
   * 分页连带规范性动作类型
   */
  getSubjectManagePage = params => postData('/subject-manage/page', params);

  /**
   * 新增八项规定题库
   */
  addQuestionConfigSave = params => postData('/question-config/save', params);

  /**
   * 删除八项规定题库
   */
  delQuestionConfigDelete = params => postData('/question-config/delete', params);

  /**
   * 八项规定题库详情
   */
  getQuestionConfigDetail = params => postData('/question-config/detail', params);

  /**
   * 更新八项规定题库
   */
  updQuestionConfigUpdate = params => postData('/question-config/update', params);

  /**
   * 获取基层联络点配置
   */
  getGrassrootsPage = params => postData('/grassroots-contact-config/page', params);

  /**
   * 新增基层联络点配置
   */
  addGrassrootsSave = params => postData('/grassroots-contact-config/save', params);

  /**
   * 基层联络点排序
   */
  grassrootsUpdateOrder = params => postData('/grassroots-contact-config/update-order', params);

  /**
   * 删除基层联络点配置
   */
  delGrassrootsRemove = params => postData('/grassroots-contact-config/remove', params);

  /**
   * 基层联络点配置详情
   */
  updateGrassroots = params => postData('/grassroots-contact-config/detail', params);

  /**
   * 更新基层联络点配置
   */
  updGrassrootsUpdate = params => postData('/grassroots-contact-config/update', params);

  /**
   * 获取领导工作计划列表
   */
  getLeaderPlanList = params => postNestedData('/research-ledger/get', params);

  /**
   * 规范性动作参数查询
   */
  getNormalityActionParams = (params) => postData('/subject-manage/list', params);

  /**
   * 获取当前人的工作计划详情
   */
  getLeaderPlanDetail = (params) => postNestedData('/research-work/list-for-plan', params);

  /**
   * 获取全部领导工作计划列表
   */
  allLeaderPlan = (params) => postNestedData('research-work/all-list-for-plan', params);

  /**
   * 业务状态变更
   */
  saveBizStatus = (params) => postData('/biz-status/save-biz-status', params);

  /**
   * 获取当前流程的答题情况和承诺
   */
  getAnswerAndPromise = (params) => getDatas('/biz-status/find-biz-status', params);

  /**
   * 发起调研安排流程
   */
  startResearchArrange = (params) => postData('/research-work/start-flow-after-submit', params);
}
export default ResearchFormService;
